package ddz;

import java.util.Vector;

public class CardSet {

	//three types
	public static int SAME = 0;

	public static int ORDER = 1;

	public static int BIOS = 2;

	public static int UNKNOWN = -1;

	protected int type = -1;

	protected Card[] primeCards;

	protected Card[] appendixCards;

	protected int primeUnits, appendixUnits, primeTotal, appendixTotal;

	/**
	 * @return the appendixCards
	 */
	public Card[] getAppendixCards() {
		return appendixCards;
	}

	/**
	 * @return the appendixTotal
	 */
	public int getAppendixTotal() {
		return appendixTotal;
	}

	/**
	 * @return the appendixUnits
	 */
	public int getAppendixUnits() {
		return appendixUnits;
	}

	/**
	 * @return the primeCards
	 */
	public Card[] getPrimeCards() {
		return primeCards;
	}

	/**
	 * @return the primeTotal
	 */
	public int getPrimeTotal() {
		return primeTotal;
	}

	/**
	 * @return the primeUnits
	 */
	public int getPrimeUnits() {
		return primeUnits;
	}

	public int getPrimeUnitLength() {
		return primeTotal / primeUnits;
	}

	public int getAppendixUnitLength() {
		return appendixTotal / appendixUnits;
	}

	/**
	 * @return the type
	 */
	public int getType() {
		return type;
	}

	public int compareTo(CardSet toCmp) {
		return -1;
	}

	public static CardSet getCardSet(CardSet[] cards) {
		int totalLength = cards.length;
		int unitLength = 0;
		int step = 0;
		int innerStep = 0;
		while (unitLength == innerStep) {
			while (innerStep == 0) {

			}
		}
		return null;
	}

	public static CardSet getCardSet(Vector<Card> cards) {
		/**
		 * the Vector is sorted in an order from min to max
		 */

		int unitLength1 = 0, unitLength2 = 0;
		Card theCard = cards.elementAt(0);
		int found = 1;
		Vector<Card> cards1 = new Vector<Card>(), cards2 = new Vector<Card>();
		for (int i = 0; i < cards.size() - 1; i++) {
			if (cards.elementAt(i + 1).getNum() == cards.elementAt(i).getNum()) {
				found++;
			} else {

			}

		}

		return null;
	}

	public CardSet(int type, Card[] primeCards, Card[] appendixCards,
			int primeUnits, int appendixUnits) {

		this.type = type;
		this.primeCards = primeCards;
		this.appendixCards = appendixCards;
		this.primeUnits = primeUnits;
		this.appendixUnits = appendixUnits;
		this.primeTotal = primeCards.length;
		this.appendixTotal = this.appendixCards.length;

	}

}
